\(\int \cos (c+d x) \cot ^4(c+d x) (a+b \sin (c+d x))^2 \, dx\) [1220]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F(-1)]
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 27, antiderivative size = 120 \[ \int \cos (c+d x) \cot ^4(c+d x) (a+b \sin (c+d x))^2 \, dx=\frac {\left (2 a^2-b^2\right ) \csc (c+d x)}{d}-\frac {a b \csc ^2(c+d x)}{d}-\frac {a^2 \csc ^3(c+d x)}{3 d}-\frac {4 a b \log (\sin (c+d x))}{d}+\frac {\left (a^2-2 b^2\right ) \sin (c+d x)}{d}+\frac {a b \sin ^2(c+d x)}{d}+\frac {b^2 \sin ^3(c+d x)}{3 d} \]

[Out]

(2*a^2-b^2)*csc(d*x+c)/d-a*b*csc(d*x+c)^2/d-1/3*a^2*csc(d*x+c)^3/d-4*a*b*ln(sin(d*x+c))/d+(a^2-2*b^2)*sin(d*x+
c)/d+a*b*sin(d*x+c)^2/d+1/3*b^2*sin(d*x+c)^3/d

Rubi [A] (verified)

Time = 0.10 (sec) , antiderivative size = 120, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.111, Rules used = {2916, 12, 962} \[ \int \cos (c+d x) \cot ^4(c+d x) (a+b \sin (c+d x))^2 \, dx=\frac {\left (a^2-2 b^2\right ) \sin (c+d x)}{d}+\frac {\left (2 a^2-b^2\right ) \csc (c+d x)}{d}-\frac {a^2 \csc ^3(c+d x)}{3 d}+\frac {a b \sin ^2(c+d x)}{d}-\frac {a b \csc ^2(c+d x)}{d}-\frac {4 a b \log (\sin (c+d x))}{d}+\frac {b^2 \sin ^3(c+d x)}{3 d} \]

[In]

Int[Cos[c + d*x]*Cot[c + d*x]^4*(a + b*Sin[c + d*x])^2,x]

[Out]

((2*a^2 - b^2)*Csc[c + d*x])/d - (a*b*Csc[c + d*x]^2)/d - (a^2*Csc[c + d*x]^3)/(3*d) - (4*a*b*Log[Sin[c + d*x]
])/d + ((a^2 - 2*b^2)*Sin[c + d*x])/d + (a*b*Sin[c + d*x]^2)/d + (b^2*Sin[c + d*x]^3)/(3*d)

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 962

Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))^(n_)*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIn
tegrand[(d + e*x)^m*(f + g*x)^n*(a + c*x^2)^p, x], x] /; FreeQ[{a, c, d, e, f, g}, x] && NeQ[e*f - d*g, 0] &&
NeQ[c*d^2 + a*e^2, 0] && IGtQ[p, 0] && (IGtQ[m, 0] || (EqQ[m, -2] && EqQ[p, 1] && EqQ[d, 0]))

Rule 2916

Int[cos[(e_.) + (f_.)*(x_)]^(p_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((c_.) + (d_.)*sin[(e_.) + (f_.)
*(x_)])^(n_.), x_Symbol] :> Dist[1/(b^p*f), Subst[Int[(a + x)^m*(c + (d/b)*x)^n*(b^2 - x^2)^((p - 1)/2), x], x
, b*Sin[e + f*x]], x] /; FreeQ[{a, b, c, d, e, f, m, n}, x] && IntegerQ[(p - 1)/2] && NeQ[a^2 - b^2, 0]

Rubi steps \begin{align*} \text {integral}& = \frac {\text {Subst}\left (\int \frac {b^4 (a+x)^2 \left (b^2-x^2\right )^2}{x^4} \, dx,x,b \sin (c+d x)\right )}{b^5 d} \\ & = \frac {\text {Subst}\left (\int \frac {(a+x)^2 \left (b^2-x^2\right )^2}{x^4} \, dx,x,b \sin (c+d x)\right )}{b d} \\ & = \frac {\text {Subst}\left (\int \left (a^2 \left (1-\frac {2 b^2}{a^2}\right )+\frac {a^2 b^4}{x^4}+\frac {2 a b^4}{x^3}+\frac {-2 a^2 b^2+b^4}{x^2}-\frac {4 a b^2}{x}+2 a x+x^2\right ) \, dx,x,b \sin (c+d x)\right )}{b d} \\ & = \frac {\left (2 a^2-b^2\right ) \csc (c+d x)}{d}-\frac {a b \csc ^2(c+d x)}{d}-\frac {a^2 \csc ^3(c+d x)}{3 d}-\frac {4 a b \log (\sin (c+d x))}{d}+\frac {\left (a^2-2 b^2\right ) \sin (c+d x)}{d}+\frac {a b \sin ^2(c+d x)}{d}+\frac {b^2 \sin ^3(c+d x)}{3 d} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.19 (sec) , antiderivative size = 103, normalized size of antiderivative = 0.86 \[ \int \cos (c+d x) \cot ^4(c+d x) (a+b \sin (c+d x))^2 \, dx=\frac {\left (6 a^2-3 b^2\right ) \csc (c+d x)-3 a b \csc ^2(c+d x)-a^2 \csc ^3(c+d x)-12 a b \log (\sin (c+d x))+3 \left (a^2-2 b^2\right ) \sin (c+d x)+3 a b \sin ^2(c+d x)+b^2 \sin ^3(c+d x)}{3 d} \]

[In]

Integrate[Cos[c + d*x]*Cot[c + d*x]^4*(a + b*Sin[c + d*x])^2,x]

[Out]

((6*a^2 - 3*b^2)*Csc[c + d*x] - 3*a*b*Csc[c + d*x]^2 - a^2*Csc[c + d*x]^3 - 12*a*b*Log[Sin[c + d*x]] + 3*(a^2
- 2*b^2)*Sin[c + d*x] + 3*a*b*Sin[c + d*x]^2 + b^2*Sin[c + d*x]^3)/(3*d)

Maple [A] (verified)

Time = 0.62 (sec) , antiderivative size = 176, normalized size of antiderivative = 1.47

method result size
derivativedivides \(\frac {a^{2} \left (-\frac {\cos ^{6}\left (d x +c \right )}{3 \sin \left (d x +c \right )^{3}}+\frac {\cos ^{6}\left (d x +c \right )}{\sin \left (d x +c \right )}+\left (\frac {8}{3}+\cos ^{4}\left (d x +c \right )+\frac {4 \left (\cos ^{2}\left (d x +c \right )\right )}{3}\right ) \sin \left (d x +c \right )\right )+2 a b \left (-\frac {\cos ^{6}\left (d x +c \right )}{2 \sin \left (d x +c \right )^{2}}-\frac {\left (\cos ^{4}\left (d x +c \right )\right )}{2}-\left (\cos ^{2}\left (d x +c \right )\right )-2 \ln \left (\sin \left (d x +c \right )\right )\right )+b^{2} \left (-\frac {\cos ^{6}\left (d x +c \right )}{\sin \left (d x +c \right )}-\left (\frac {8}{3}+\cos ^{4}\left (d x +c \right )+\frac {4 \left (\cos ^{2}\left (d x +c \right )\right )}{3}\right ) \sin \left (d x +c \right )\right )}{d}\) \(176\)
default \(\frac {a^{2} \left (-\frac {\cos ^{6}\left (d x +c \right )}{3 \sin \left (d x +c \right )^{3}}+\frac {\cos ^{6}\left (d x +c \right )}{\sin \left (d x +c \right )}+\left (\frac {8}{3}+\cos ^{4}\left (d x +c \right )+\frac {4 \left (\cos ^{2}\left (d x +c \right )\right )}{3}\right ) \sin \left (d x +c \right )\right )+2 a b \left (-\frac {\cos ^{6}\left (d x +c \right )}{2 \sin \left (d x +c \right )^{2}}-\frac {\left (\cos ^{4}\left (d x +c \right )\right )}{2}-\left (\cos ^{2}\left (d x +c \right )\right )-2 \ln \left (\sin \left (d x +c \right )\right )\right )+b^{2} \left (-\frac {\cos ^{6}\left (d x +c \right )}{\sin \left (d x +c \right )}-\left (\frac {8}{3}+\cos ^{4}\left (d x +c \right )+\frac {4 \left (\cos ^{2}\left (d x +c \right )\right )}{3}\right ) \sin \left (d x +c \right )\right )}{d}\) \(176\)
parallelrisch \(\frac {64 \ln \left (\sec ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a b -64 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a b -3 \csc \left (\frac {d x}{2}+\frac {c}{2}\right ) \left (a^{2} \left (\sec ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \left (\cos \left (2 d x +2 c \right )-\frac {\cos \left (4 d x +4 c \right )}{12}-\frac {25}{36}\right ) \left (\csc ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\frac {3 b \left (\cos \left (2 d x +2 c \right )-\frac {\cos \left (4 d x +4 c \right )}{9}\right ) \sec \left (\frac {d x}{2}+\frac {c}{2}\right ) a \csc \left (\frac {d x}{2}+\frac {c}{2}\right )}{2}-\frac {20 b^{2} \left (\cos \left (2 d x +2 c \right )+\frac {\cos \left (4 d x +4 c \right )}{20}-\frac {9}{4}\right )}{9}\right ) \sec \left (\frac {d x}{2}+\frac {c}{2}\right )}{16 d}\) \(176\)
norman \(\frac {-\frac {a^{2}}{24 d}-\frac {a^{2} \left (\tan ^{12}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{24 d}+\frac {\left (3 a^{2}-2 b^{2}\right ) \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4 d}+\frac {\left (3 a^{2}-2 b^{2}\right ) \left (\tan ^{10}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4 d}+\frac {5 \left (11 a^{2}-10 b^{2}\right ) \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{6 d}+\frac {\left (43 a^{2}-48 b^{2}\right ) \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{8 d}+\frac {\left (43 a^{2}-48 b^{2}\right ) \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{8 d}+\frac {21 a b \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4 d}+\frac {21 a b \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4 d}-\frac {a b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{4 d}-\frac {a b \left (\tan ^{11}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4 d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{3} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}-\frac {4 a b \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}+\frac {4 a b \ln \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}\) \(300\)
risch \(4 i x a b +\frac {i b^{2} {\mathrm e}^{3 i \left (d x +c \right )}}{24 d}-\frac {a b \,{\mathrm e}^{2 i \left (d x +c \right )}}{4 d}-\frac {i a^{2} {\mathrm e}^{i \left (d x +c \right )}}{2 d}+\frac {7 i {\mathrm e}^{i \left (d x +c \right )} b^{2}}{8 d}+\frac {i a^{2} {\mathrm e}^{-i \left (d x +c \right )}}{2 d}-\frac {7 i {\mathrm e}^{-i \left (d x +c \right )} b^{2}}{8 d}-\frac {a b \,{\mathrm e}^{-2 i \left (d x +c \right )}}{4 d}-\frac {i b^{2} {\mathrm e}^{-3 i \left (d x +c \right )}}{24 d}+\frac {8 i a b c}{d}+\frac {2 i \left (6 a^{2} {\mathrm e}^{5 i \left (d x +c \right )}-3 b^{2} {\mathrm e}^{5 i \left (d x +c \right )}-8 a^{2} {\mathrm e}^{3 i \left (d x +c \right )}+6 b^{2} {\mathrm e}^{3 i \left (d x +c \right )}-6 i a b \,{\mathrm e}^{4 i \left (d x +c \right )}+6 a^{2} {\mathrm e}^{i \left (d x +c \right )}-3 b^{2} {\mathrm e}^{i \left (d x +c \right )}+6 i a b \,{\mathrm e}^{2 i \left (d x +c \right )}\right )}{3 d \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )^{3}}-\frac {4 a b \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )}{d}\) \(308\)

[In]

int(cos(d*x+c)^5*csc(d*x+c)^4*(a+b*sin(d*x+c))^2,x,method=_RETURNVERBOSE)

[Out]

1/d*(a^2*(-1/3/sin(d*x+c)^3*cos(d*x+c)^6+1/sin(d*x+c)*cos(d*x+c)^6+(8/3+cos(d*x+c)^4+4/3*cos(d*x+c)^2)*sin(d*x
+c))+2*a*b*(-1/2/sin(d*x+c)^2*cos(d*x+c)^6-1/2*cos(d*x+c)^4-cos(d*x+c)^2-2*ln(sin(d*x+c)))+b^2*(-1/sin(d*x+c)*
cos(d*x+c)^6-(8/3+cos(d*x+c)^4+4/3*cos(d*x+c)^2)*sin(d*x+c)))

Fricas [A] (verification not implemented)

none

Time = 0.39 (sec) , antiderivative size = 158, normalized size of antiderivative = 1.32 \[ \int \cos (c+d x) \cot ^4(c+d x) (a+b \sin (c+d x))^2 \, dx=\frac {2 \, b^{2} \cos \left (d x + c\right )^{6} - 6 \, {\left (a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{4} + 24 \, {\left (a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} - 24 \, {\left (a b \cos \left (d x + c\right )^{2} - a b\right )} \log \left (\frac {1}{2} \, \sin \left (d x + c\right )\right ) \sin \left (d x + c\right ) - 16 \, a^{2} + 16 \, b^{2} - 3 \, {\left (2 \, a b \cos \left (d x + c\right )^{4} - 3 \, a b \cos \left (d x + c\right )^{2} - a b\right )} \sin \left (d x + c\right )}{6 \, {\left (d \cos \left (d x + c\right )^{2} - d\right )} \sin \left (d x + c\right )} \]

[In]

integrate(cos(d*x+c)^5*csc(d*x+c)^4*(a+b*sin(d*x+c))^2,x, algorithm="fricas")

[Out]

1/6*(2*b^2*cos(d*x + c)^6 - 6*(a^2 - b^2)*cos(d*x + c)^4 + 24*(a^2 - b^2)*cos(d*x + c)^2 - 24*(a*b*cos(d*x + c
)^2 - a*b)*log(1/2*sin(d*x + c))*sin(d*x + c) - 16*a^2 + 16*b^2 - 3*(2*a*b*cos(d*x + c)^4 - 3*a*b*cos(d*x + c)
^2 - a*b)*sin(d*x + c))/((d*cos(d*x + c)^2 - d)*sin(d*x + c))

Sympy [F(-1)]

Timed out. \[ \int \cos (c+d x) \cot ^4(c+d x) (a+b \sin (c+d x))^2 \, dx=\text {Timed out} \]

[In]

integrate(cos(d*x+c)**5*csc(d*x+c)**4*(a+b*sin(d*x+c))**2,x)

[Out]

Timed out

Maxima [A] (verification not implemented)

none

Time = 0.20 (sec) , antiderivative size = 103, normalized size of antiderivative = 0.86 \[ \int \cos (c+d x) \cot ^4(c+d x) (a+b \sin (c+d x))^2 \, dx=\frac {b^{2} \sin \left (d x + c\right )^{3} + 3 \, a b \sin \left (d x + c\right )^{2} - 12 \, a b \log \left (\sin \left (d x + c\right )\right ) + 3 \, {\left (a^{2} - 2 \, b^{2}\right )} \sin \left (d x + c\right ) - \frac {3 \, a b \sin \left (d x + c\right ) - 3 \, {\left (2 \, a^{2} - b^{2}\right )} \sin \left (d x + c\right )^{2} + a^{2}}{\sin \left (d x + c\right )^{3}}}{3 \, d} \]

[In]

integrate(cos(d*x+c)^5*csc(d*x+c)^4*(a+b*sin(d*x+c))^2,x, algorithm="maxima")

[Out]

1/3*(b^2*sin(d*x + c)^3 + 3*a*b*sin(d*x + c)^2 - 12*a*b*log(sin(d*x + c)) + 3*(a^2 - 2*b^2)*sin(d*x + c) - (3*
a*b*sin(d*x + c) - 3*(2*a^2 - b^2)*sin(d*x + c)^2 + a^2)/sin(d*x + c)^3)/d

Giac [A] (verification not implemented)

none

Time = 0.39 (sec) , antiderivative size = 127, normalized size of antiderivative = 1.06 \[ \int \cos (c+d x) \cot ^4(c+d x) (a+b \sin (c+d x))^2 \, dx=\frac {b^{2} \sin \left (d x + c\right )^{3} + 3 \, a b \sin \left (d x + c\right )^{2} - 12 \, a b \log \left ({\left | \sin \left (d x + c\right ) \right |}\right ) + 3 \, a^{2} \sin \left (d x + c\right ) - 6 \, b^{2} \sin \left (d x + c\right ) + \frac {22 \, a b \sin \left (d x + c\right )^{3} + 6 \, a^{2} \sin \left (d x + c\right )^{2} - 3 \, b^{2} \sin \left (d x + c\right )^{2} - 3 \, a b \sin \left (d x + c\right ) - a^{2}}{\sin \left (d x + c\right )^{3}}}{3 \, d} \]

[In]

integrate(cos(d*x+c)^5*csc(d*x+c)^4*(a+b*sin(d*x+c))^2,x, algorithm="giac")

[Out]

1/3*(b^2*sin(d*x + c)^3 + 3*a*b*sin(d*x + c)^2 - 12*a*b*log(abs(sin(d*x + c))) + 3*a^2*sin(d*x + c) - 6*b^2*si
n(d*x + c) + (22*a*b*sin(d*x + c)^3 + 6*a^2*sin(d*x + c)^2 - 3*b^2*sin(d*x + c)^2 - 3*a*b*sin(d*x + c) - a^2)/
sin(d*x + c)^3)/d

Mupad [B] (verification not implemented)

Time = 11.75 (sec) , antiderivative size = 315, normalized size of antiderivative = 2.62 \[ \int \cos (c+d x) \cot ^4(c+d x) (a+b \sin (c+d x))^2 \, dx=\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (6\,a^2-4\,b^2\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8\,\left (23\,a^2-36\,b^2\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,\left (36\,a^2-44\,b^2\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6\,\left (\frac {158\,a^2}{3}-\frac {164\,b^2}{3}\right )-\frac {a^2}{3}-6\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+26\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+30\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7-2\,a\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left (8\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^9+24\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7+24\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+8\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\right )}-\frac {a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{24\,d}+\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (\frac {7\,a^2}{8}-\frac {b^2}{2}\right )}{d}-\frac {a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{4\,d}-\frac {4\,a\,b\,\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{d}+\frac {4\,a\,b\,\ln \left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}{d} \]

[In]

int((cos(c + d*x)^5*(a + b*sin(c + d*x))^2)/sin(c + d*x)^4,x)

[Out]

(tan(c/2 + (d*x)/2)^2*(6*a^2 - 4*b^2) + tan(c/2 + (d*x)/2)^8*(23*a^2 - 36*b^2) + tan(c/2 + (d*x)/2)^4*(36*a^2
- 44*b^2) + tan(c/2 + (d*x)/2)^6*((158*a^2)/3 - (164*b^2)/3) - a^2/3 - 6*a*b*tan(c/2 + (d*x)/2)^3 + 26*a*b*tan
(c/2 + (d*x)/2)^5 + 30*a*b*tan(c/2 + (d*x)/2)^7 - 2*a*b*tan(c/2 + (d*x)/2))/(d*(8*tan(c/2 + (d*x)/2)^3 + 24*ta
n(c/2 + (d*x)/2)^5 + 24*tan(c/2 + (d*x)/2)^7 + 8*tan(c/2 + (d*x)/2)^9)) - (a^2*tan(c/2 + (d*x)/2)^3)/(24*d) +
(tan(c/2 + (d*x)/2)*((7*a^2)/8 - b^2/2))/d - (a*b*tan(c/2 + (d*x)/2)^2)/(4*d) - (4*a*b*log(tan(c/2 + (d*x)/2))
)/d + (4*a*b*log(tan(c/2 + (d*x)/2)^2 + 1))/d